﻿//////////////////////////////////////////////////////////////////////////////
//
//  Copyright © 1998-2024 Glodon Company Limited.  All rights reserved.
//
//  Use of this software is subject to the terms of the Glodon license
//  agreement provided at the time of installation or download, or which
//  otherwise accompanies this software in either electronic or hard copy form.  
//
//////////////////////////////////////////////////////////////////////////////

#pragma once

#include "GmPositioningElements.h"
#include "Intervald.h"
#include "Vector3d.h"
#include "ElementId.h"
#include "ElementCreationOptions.h"

namespace gcmp 
{
    class IPlane;
    class IGraphicsElementShape;
    class IDocument;
    class IGridNew;
    class ICurve3d;
    class ICurve2d;
    struct GridNewInput;

    // 轴网相关工具函数
    class GM_POSITIONING_ELEMENTS_EXPORT GridNewUtils
    {
    public:
        // 判断给定轴网名字是否合法
        static bool IsNameValid(const std::wstring& name);

        // 判断给定轴网名字是否重复
        static bool IsNameDuplicated(const IDocument* pDoc, const std::wstring& name);

        // 给定一个轴网编号，推算下一个轴网编号。
        // 推算成功，则令nextName为推算结果，返回true
        // 否则，令nextName==currName，返回false
        static bool GetNextName(const std::wstring& currName, std::wstring& nextName);

        static Intervald GetGridDefaultVerticalExtents(const IDocument* pDoc, const IPlane * pPlane, ElementCreationOptions eco = ElementCreationOptions::Normal);

        //根据属性面板设设置起点终点Tag的可见性
        static bool setGridNewPresetParameter(const IDocument* pDoc, bool& startTagVisble, bool& endTagVisble);
    };

}// namespace gcmp
